<template>
 <router-link :to="to" data-test='post'
    class="panel-block"
    style="display: flex; align-items: center">
    <div style="display: flex; align-items: center; justify-content: center">
      <a>{{ post.title }}</a>
      <div style="margin-left: 10px">
        {{ post.created.format("yyyy-MM-DD") }}
      </div>
    </div>
 </router-link>
</template>
<script lang="ts">
import { Post } from "@/types";
export default {
  name: "TimelinePost",
  props: {
    post: {
      type: Object as () => Post,
      required: true,
    },
  },
  setup(props:any){
    return {to:`/posts/${props.post.id}`}
  }
};
</script>
<style>
</style>
